/** Package GUI version 1.0. In questo package troverete tutti i casi d'uso implementati per l'utilizzo delle procedure del package GUI. */

CREATE OR REPLACE
package transazioni_gruppo36 as

ROOT_URL VARCHAR2(512) := 'http://oracle3.cli.di.unipi.it/apex/RICCI.transazioni_gruppo36.';

OPERATION_TYPE_PRODOTTO VARCHAR2(512) := '0';
OPERATION_TYPE_RICETTA VARCHAR2(512) := '1';
OPERATION_TYPE_RICARICA VARCHAR2(512) := '2';

emptyArrayIntVarchar package_gui_statics.arrayIntVarchar;

root constant VARCHAR2(20) := '/apex/RICCI.';
packageName constant VARCHAR2(20) := 'package_transazioni.';

viewTransactionPath constant VARCHAR2(70) := root || packageName || 'viewTransaction';
insTransactionPath constant VARCHAR2(70) := root || packageName || 'insTransaction';
editTransactionPath constant VARCHAR2(70) := root || packageName || 'editTransaction';
delTransactionPath constant VARCHAR2(70) := root || packageName || 'delTransaction';
viewSingleTransactionPath constant VARCHAR2(70) := root || packageName || 'viewSingleTransaction';

NOT_VALID_VENDITA_PRODOTTO EXCEPTION;
NOT_VALID_VENDITA_RICETTA EXCEPTION;
NOT_VALID_RICARICA EXCEPTION;
MALFORMED_STRING_FORMAT EXCEPTION;

PROCEDURE searchSales (
  private_session VARCHAR2 DEFAULT NULL
);

PROCEDURE searchRefills (
  private_session VARCHAR2 DEFAULT NULL
);

PROCEDURE delTransaction(
  private_session VARCHAR2 DEFAULT NULL,
  transaction_type VARCHAR2 DEFAULT NULL,
  filter_type VARCHAR2 DEFAULT NULL,
  distributor VARCHAR2 DEFAULT NULL,
  range_date_from VARCHAR2 DEFAULT NULL,
  range_date_to VARCHAR2 DEFAULT NULL,
  filter_choice VARCHAR2 DEFAULT NULL,
  filter_month VARCHAR2 DEFAULT NULL,
  filter_year_month VARCHAR2 DEFAULT NULL,
  filter_trim VARCHAR2 DEFAULT NULL,
  filter_year_trim VARCHAR2 DEFAULT NULL,
  filter_year VARCHAR2 DEFAULT NULL,
  filter_cod_chiavetta VARCHAR2 DEFAULT NULL,
  trans_type NUMBER DEFAULT NULL,
  id package_gui_statics.arrayIntVarchar DEFAULT emptyArrayIntVarchar
);

PROCEDURE viewSingleTransaction(
  private_session VARCHAR2 DEFAULT NULL,
  transaction_type VARCHAR2 DEFAULT NULL,
  filter_type VARCHAR2 DEFAULT NULL,
  distributor VARCHAR2 DEFAULT NULL,
  range_date_from VARCHAR2 DEFAULT NULL,
  range_date_to VARCHAR2 DEFAULT NULL,
  filter_choice VARCHAR2 DEFAULT NULL,
  filter_month VARCHAR2 DEFAULT NULL,
  filter_year_month VARCHAR2 DEFAULT NULL,
  filter_trim VARCHAR2 DEFAULT NULL,
  filter_year_trim VARCHAR2 DEFAULT NULL,
  filter_year VARCHAR2 DEFAULT NULL,
  filter_cod_chiavetta VARCHAR2 DEFAULT NULL,
  trans_type NUMBER DEFAULT NULL,
  id NUMBER DEFAULT NULL
);

PROCEDURE searchTransactions (
  private_session VARCHAR2 DEFAULT NULL,
  transaction_type VARCHAR2 DEFAULT NULL,
  filter_type VARCHAR2 DEFAULT NULL,
  distributor VARCHAR2 DEFAULT NULL,
  range_date_from VARCHAR2 DEFAULT NULL,
  range_date_to VARCHAR2 DEFAULT NULL,
  filter_choice VARCHAR2 DEFAULT NULL,
  filter_month VARCHAR2 DEFAULT NULL,
  filter_year_month VARCHAR2 DEFAULT NULL,
  filter_trim VARCHAR2 DEFAULT NULL,
  filter_year_trim VARCHAR2 DEFAULT NULL,
  filter_year VARCHAR2 DEFAULT NULL,
  filter_cod_chiavetta VARCHAR2 DEFAULT NULL,
  submit_button_form VARCHAR2 DEFAULT NULL
);

-- procedura per la visualizzazione degli slot
procedure viewTransactions(
  private_session VARCHAR2 DEFAULT NULL,
  page BINARY_INTEGER DEFAULT 1,
  transaction_type VARCHAR2 DEFAULT NULL,
  filter_type VARCHAR2 DEFAULT NULL,
  distributor VARCHAR2 DEFAULT NULL,
  range_date_from VARCHAR2 DEFAULT NULL,
  range_date_to VARCHAR2 DEFAULT NULL,
  filter_choice VARCHAR2 DEFAULT NULL,
  filter_month VARCHAR2 DEFAULT NULL,
  filter_year_month VARCHAR2 DEFAULT NULL,
  filter_trim VARCHAR2 DEFAULT NULL,
  filter_year_trim VARCHAR2 DEFAULT NULL,
  filter_year VARCHAR2 DEFAULT NULL,
  filter_cod_chiavetta VARCHAR2 DEFAULT NULL,
  submit_button_form VARCHAR2 DEFAULT NULL,
  private_status_error_message VARCHAR2 DEFAULT NULL,
  private_status_success_message VARCHAR2 DEFAULT NULL
);

procedure renderUploadLog (
  private_session VARCHAR2 DEFAULT NULL,
  private_status_error_message VARCHAR2 DEFAULT NULL,
  private_status_success_message VARCHAR2 DEFAULT NULL,
  transaction_log VARCHAR2 DEFAULT NULL
);

procedure processLog (
  private_session VARCHAR2 DEFAULT NULL,
  submit_button_form VARCHAR2 DEFAULT NULL,
  transaction_log VARCHAR2 DEFAULT NULL
);

end transazioni_gruppo36;

